Skip to content

Only drag on auto scroll when the container scrolled - #693

Merged
NullVoxPopuli merged 1 commit into
adopted-ember-addons:masterfrom
johanrd:auto-scroll-settle
Nov 9, 2026
Merged

NullVoxPopuli merged 1 commit into
adopted-ember-addons:masterfrom
johanrd:auto-scroll-settle

Conversation

@johanrd

@johanrd johanrd commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

The container auto scroll tests take 1 to 90 seconds on CI and sometimes time out at 60 seconds, also on master.

At the end of the scroll container, checkScrollBounds calls drag on every animation frame, also when the container did not scroll. Each call re-arms the updateInterval throttle, so settled() only resolves if a poll falls between two frames. The drag test helper sends mouseup only after settled().

Now drag runs only when the container scrolled. If it did not scroll, the call did not move the item.

Other libraries also do no work when the container cannot scroll further:

Library At the end of the scroll container
SortableJS (AutoScroll.js#L226-L245) vy is 0 when scrollPosY + height reaches scrollHeight, so the scroll interval is cleared.
dnd-kit (Scroller.ts#L169-L231) canScroll() is false, so scroll() returns false and schedules nothing.
ember-sortable (this PR) The scroll delta is 0, so drag is not called.

Time of the two container auto scroll tests on CI, all jobs:

Samples Median p90 Maximum Over 60 s
Before: master, 11 runs since August 274 9.9 s 36.3 s 90.0 s 12
After: this branch, 2 runs on a fork 64 4.8 s 6.7 s 6.7 s 0

At the end of the scroll container, checkScrollBounds called drag on
every animation frame. Each call re-armed the updateInterval throttle,
so settled() only resolved if a poll fell between two frames. The
container auto scroll tests then took 1 to 90 seconds on CI and
sometimes timed out.
@netlify

netlify Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for ember-sortable canceled.

Name Link
🔨 Latest commit a7593ab
🔍 Latest deploy log https://app.netlify.com/projects/ember-sortable/deploys/6aef767deeaad304b07ba60c

@NullVoxPopuli
NullVoxPopuli merged commit e77d828 into adopted-ember-addons:master Nov 9, 2026
23 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants